const zlib = require('zlib');
const gzip = zlib.createGzip();
const fs = require('fs');
let buf = Buffer.from('');

var path = require('path');

// The zip library needs to be instantiated:
var zip = new require('node-zip')();

// You can add multiple files by performing subsequent calls to zip.file();
// the first argument is how you want the file to be named inside your zip,
// the second is the actual data:
zip.file('a.js', "zzz");
zip.file('b.js', "拉拉拉拉啊");
zip.folder("images/img").file('text.text','zzzz');
var data = zip.generate({ base64:false, compression: 'DEFLATE' });

// it's important to use *binary* encode
fs.writeFileSync('test.zip', data, 'binary')
